package hhh.app.presenter.di.module;

import javax.inject.Named;

import dagger.Module;
import dagger.Provides;
import hhh.app.domain.interactor.GetCarts;
import hhh.app.domain.interactor.GetCategories;
import hhh.app.domain.interactor.GetProductDetail;
import hhh.app.domain.interactor.GetProductDiscounts;
import hhh.app.domain.interactor.GetProductImages;
import hhh.app.domain.interactor.GetProductOptions;
import hhh.app.domain.interactor.GetProductReview;
import hhh.app.domain.interactor.GetProducts;
import hhh.app.domain.interactor.ProductCase;
import hhh.app.domain.repository.ProductRepository;
import hhh.app.presenter.di.PerActivity;

/**
 * Created by hhh on 2016/12/13.
 */
@Module
public class ProductModule {
//    private int pid=-1;
//    private int page=1;
//    private String type="all";

    public ProductModule() {
//        this.pid = pid;
    }

//    public ProductModule(int page,String type){
//        this.page=page;
//        this.type=type;
//    }

    @Provides
    @PerActivity
    @Named("productUrl")
    ProductCase provideGetProductListCase(ProductRepository productRepository){
//        return getProductList;
        return new GetProducts(productRepository);
    }

    @Provides
    @PerActivity
    @Named("productDetail")
    ProductCase provideGetProductDetailCase(ProductRepository productRepository){
//        return getProductDetail;
        return new GetProductDetail(productRepository);
    }

    @Provides
    @PerActivity
    @Named("categories")
    ProductCase provideGetCategories(ProductRepository productRepository){
        return new GetCategories(productRepository);
    }

    @Provides
    @PerActivity
    @Named("carts")
    ProductCase provideGetCarts(ProductRepository productRepository){
        return new GetCarts(productRepository);
    }

    @Provides
    @PerActivity
    @Named("productDiscounts")
    ProductCase provideGetProductDiscounts(ProductRepository productRepository){
        return new GetProductDiscounts(productRepository);
    }

    @Provides
    @PerActivity
    @Named("productImages")
    ProductCase provideGetProductImages(ProductRepository productRepository){
        return new GetProductImages(productRepository);
    }

    @Provides
    @PerActivity
    @Named("productOptions")
    ProductCase provideGetProductOptions(ProductRepository productRepository){
        return new GetProductOptions(productRepository);
    }

    @Provides
    @PerActivity
    @Named("productReview")
    ProductCase provideGetProductReviews(ProductRepository productRepository){
        return new GetProductReview(productRepository);
    }
}
